package com.cadre.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;

import com.cadre.entity.User;

//@Repository("cuserMapper")
public interface UserMapper {
	
	
	public boolean register(User user);

	public User login(User user);

//	public boolean isexit(@Param("username")String username);
 
	//------------------------------
	//村干部对村民信息进行管理 1.查询村民信息、2.修改村民休息、3.删除村民信息。
	
		public List<User> SelectAllUser();
		
		public User SelectUserId(Integer id);
		public boolean UpdataUser(User user);
		
		public boolean deleteUserById(Integer id);

		public User isexit(@Param("username")String username);

	//添加
		/*public boolean addUser(User user);*/
		
		
		
		/*
		 * 梁------------------------------>
		 */

		public List<User> selectAllUser();
		//删除村民账号
		public boolean deleteUser(Integer id);
		//编辑
		//public boolean updateUser(User user);
		//根据id查询村民账号
	/*	public User selectUserById(Integer id);*/
		
		//按名字模糊搜索用户（user村民）
		public List<User> selectUser1(@Param("name")String name);
		
		
		/*
		 * ------------------彭
		 */
		//根据id查询用户信息
		public User selectUserById3(Integer id);
//		
		//修改信息
		public boolean UpdataUser3(User user);
		
		//根据用户名和密码查询用户
		public User selectUser(@Param("username")String username,@Param("password") String password);
		
		public User selectUsernameByUserid(Integer userid);
		
		

}
